package com.blueline.passtong.client;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import com.blueline.passtong.R;

public class DiscountWebViewClient extends WebViewClient {

	@Override
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		view.loadUrl(url);
		return true;
	}

	@Override
	public void onPageFinished(WebView view, String url) {
		// TODO Auto-generated method stub
		super.onPageFinished(view, url);
		view.setVisibility(View.VISIBLE);
		Context context = view.getContext();
		if (context instanceof Activity) {
			Activity activity = (Activity) context;
			ProgressBar progress = (ProgressBar)activity.findViewById(R.id.progressBar1);
			progress.setVisibility(View.GONE);
		}
	}

}
